#!/bin/sh

if [ "$#" -ne "2" ] ; then
  echo "Usage: `basename $0` <service> <file>"
  exit 1
fi

if [ ! -f "$2" ] ; then
  echo "Specified file doesn't exist: $2"
  exit 2
fi

CONTENTTYPE="text/xml"
#CONTENTTYPE="application/soap+xml"
ENDPOINT=http://localhost:8080/hhpoll/services/$1

curl --trace log.txt --user "smitten@gmail.com:password" -d @"$2" -H "Content-type: $CONTENTTYPE" $ENDPOINT
